import mysql from "mysql2/promise";

// 从环境变量读取数据库配置
const pool = mysql.createPool({
  host: "wrh.plus",
  user: "huichen",
  password: "d90f5de39c",
  database: "huichen",
  dateStrings: true,
});
// 连接数据库
async () => {
  try {
    const connection = await pool.getConnection();
    console.log("连接到数据库");
    connection.release();
  } catch (error) {
    console.error("连接数据库时出错:", error);
  }
};

export default pool;
